//ajax读取数据
function getAjaxData(url,param){
	var defer = $.Deferred();
	$.ajax({
       url : url, 
       type : "POST",       
       headers: headers,
       data: param,
       async: false,
       dataType:"text",
       success: function(data){
           defer.resolve(data)
       }
    }); 
    return defer.promise();
}

//加载数据
function executeAjax(url,param,fn){
    $.when(getAjaxData(url,param)).done(function(data){
	   	fn(data);
    });
}



var retMsg;

function ajaxCall(rurl, pars){
	$.ajax({
	   type: "POST",
	   headers: headers,
	   url: rurl,
	   data: pars,
	   async: false,
	   dataType:"text",
	   success: function(msg){
	      retMsg  = msg;
	   },
	   error:function(data){
	   		
	   }
	}); 
}

function executeAjaxBySync(url, pars){
	ajaxCall(url, pars);
	return retMsg;
}
